<template>
	<view class="gift-purchase">
            <view class="header" style="z-index: 99;">
        <view><uni-status-bar></uni-status-bar></view>
  
        <view class="search-box flex-cn"> 
          <view class="navbar-left flex-cn" style="flex: 1" @click="backHome">
            <view
              style="width: 100rpx; text-align: center;color: #fff;"
              class="qh-rt-single qh-rt-zuo-zuo navbar-back-icon"
            >
            </view>
          </view>
  
          <view
              style="
                  height: 80rpx;
                  line-height: 80rpx;
                  font-size: 36rpx;
                  font-family: '.PingFang SC, PingFang SC';
                  display: flex;
                  justify-content: center;
                  align-content: center;
                  flex: 1;
                  color: #fff;
                  font-weight: 600;
              "
              >
              邀请入群
              </view>
              <view style="width: 320rpx; flex: 1"></view>
          </view>   
      </view> 
      
      <img style="position: absolute;top:0;left:0; height: 100%;width: 100%;" src="https://safood-1317438654.cos.ap-guangzhou.myqcloud.com/Uploads/Admin/ImageGallery/664c04ba6c0473672.png" alt="">

      
      <view style="position: absolute;left:22%;top:37.5%;"> 
        <view style="background-color: #FFB73F;border-radius: 16rpx;">
          <image style="padding: 24rpx;padding-bottom: 16rpx; height: 380rpx; width: 380rpx;" mode="heightFix" :src="picURL1" show-menu-by-longpress @longpress="seeQRcode"></image>
        </view>
        <!-- style="position: absolute;left:25%;top: 41.5%; width: 100%;" -->
      </view>
      
	</view>

  </template>

<script>
export default {
    data() {
      return {
        picURL1:""
      }

    }, 
    onLoad(){
      this.getBusinessWeChatCode()
    },


    methods: {
      backHome() {
			  uni.navigateBack();
		 },

    async getBusinessWeChatCode(){
				const result = await this.$request(
				'/SmallProgramApi/ShiFu/getBusinessWeChatCode',
				{ store_id: this.$store.mallStoreId }
				)
        this.picURL1  = result.data.img_url
     },
      handleLongPress(event) {
        if (typeof wx !== 'undefined') { // 检查是否在微信小程序环境
          wx.scanCode({
            onlyFromCamera: false, // 是否只能从相机扫码，不允许从相册选择图片
            scanType: ['qrCode'], // 扫码类型
            success: (res) => {
              console.log('扫码成功，结果为：', res.result);
              // 在这里处理扫码得到的结果
            },
            fail: (err) => {
              console.error('扫码失败', err);
            }
          });
        } else {
          uni.showModal({ // 如果不在微信小程序环境下，可以提示用户仅支持微信内使用
            title: '提示',
            content: '此功能仅在微信小程序内可用，请在微信中打开',
            showCancel: false
          });
        }
      },




    },
  

}

</script>

<style scoped lang="scss">


.header{
    position: absolute;
}
.back{
    background-image: url("https://safood-1317438654.cos.ap-guangzhou.myqcloud.com/Uploads/tempImage/664b0c0a83e8e5369.png");
    background-repeat: no-repeat;
    background-size: cover;
}
.gift-purchase {
    overflow-y: auto;
    height: 100vh;  /* 视窗的高度 */
    width: 100%;
    background-color: #F0F2EE;
    position: relative;
}

.limit_bottom {
  padding-bottom: env(safe-area-inset-bottom);

}



</style>